import {Vector} from "./vector.js";

export const MAX_GRID_WIDTH = 2000;
export const MAX_GRID_HEIGHT = 600;

export const SPECIAL_VALUE = "+";
export const ALT_SPECIAL_VALUE = "^";
export const SPECIAL_ARROW_LEFT = "<";
export const SPECIAL_ARROW_UP = "^";
export const SPECIAL_ARROW_RIGHT = ">";
export const SPECIAL_ARROW_DOWN = "v";
export const SPECIAL_VALUES = ["+", "\u2012", "\u2013", "-", "|"];
export const ALT_SPECIAL_VALUES = [">", "<", "^", "v"];
export const ALL_SPECIAL_VALUES = SPECIAL_VALUES.concat(ALT_SPECIAL_VALUES);

export const MAX_UNDO = 50;

export const SPECIAL_LINE_H = "-";
export const SPECIAL_LINE_V = "|";

export const ERASE_CHAR = "\u2009";

// Milliseconds.
export const DRAG_LATENCY = 150;
// Pixels.
export const DRAG_ACCURACY = 6;

export const CHAR_PIXELS_H = 9;
export const CHAR_PIXELS_V = 17;

export const RENDER_PADDING_CELLS = 3;

export const KEY_COPY = "Copy";
export const KEY_PASTE = "Paste";
export const KEY_CUT = "Cut";

// What's the best way to detect a 'touch screen' device using JavaScript?
// https://stackoverflow.com/q/4817029
// Well... http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
//export const TOUCH_ENABLED =
//  "ontouchstart" in window ||
//  "onmsgesturechange" in window;

export const DIR_LEFT = new Vector(-1, 0);
export const DIR_RIGHT = new Vector(1, 0);
export const DIR_UP = new Vector(0, -1);
export const DIR_DOWN = new Vector(0, 1);

export const DIRECTIONS = [DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_DOWN];
